const configs = require("../config");
const knex = require("knex");
module.exports = knex({
  client: "mysql",
  connection: {
    host: configs.mysql.host,
    port: configs.mysql.port,
    user: configs.mysql.user,
    password: configs.mysql.password,
    database: configs.mysql.database,
  },
  // 打印错误
  log: {
    error(message) {
      console.log("[knex error]", message);
    },
  },
});
